import os


def read_yml():
    # 当前目录父目录
    f = os.pardir
    # 文件f路径
    cur_path = os.path.dirname(f)
    # 文件f名字
    f_name = os.path.basename(f)
    # config/db.yml路径
    db_path = os.path.join(f, "config", "db.yml")
    print(f"当前目录父目录={f},当前文件路径={cur_path},当前文件名={f_name},db.yml路径={db_path}")
    print(os.getcwd())
    print(os.path.abspath(f))


if __name__ == '__main__':
    read_yml()
